package com.study.webapp.socket.bio;

import java.util.concurrent.*;

public class TimeServerHandlerExecutorPool {

    private ExecutorService executorService;

    public TimeServerHandlerExecutorPool(int maxSize,int poolSize) {
        executorService = new ThreadPoolExecutor(Runtime.getRuntime().availableProcessors(),
                maxSize,120L, TimeUnit.SECONDS,new ArrayBlockingQueue<>(poolSize));
    }

    public void execute(Runnable task) {
        executorService.execute(task);
    }
}
